package com.usian.utils.common;

import lombok.extern.slf4j.Slf4j;

import java.util.HashMap;

@Slf4j
public class StringUtils {

    /**
     * 截取fastdfs相关的路径
     * @param path
     * @return
     */
    public static HashMap<String,String>  subStringPath(String path){
        int i = path.indexOf("/");
        log.info("================>i:{}}",i);
        String group = path.substring(0, i);
        String imgPath = path.substring(i+1);
        log.info("================>group:{},imgPath:{}",group,imgPath);
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("group",group);
        hashMap.put("imgPath",imgPath);
        return hashMap;
    }

    public static String substringPath(String path){
        int i = path.indexOf("/",8);
        String subString  = path.substring(i+1);
        return subString;
    }
}
